import { db } from "@common/database/db";

export const SysUserRoleDao = {
    getUserRoleIds: async (user_id: number | string) => {
        const userId = Number(user_id);
        const res  = await db.selectFrom('sys_user_role').select('role_id').where('user_id', '=', userId).execute();
        // 提取 role_id 并转换为 number 类型数组
        return res.map(row => Number(row.role_id));
    }
}
